import Vue from 'vue'
import App from './App.vue'
import Router from 'vue-router'

Vue.config.productionTip = false
Vue.use(Router)

const router = new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      component: () => import('@/components/HelloWorld.vue'),
    },
    {
      path: '/test',
      component: async function(){
        try{
          return await import('@/components/Test.vue')
        } catch(err) {
          alert('网站更新了，请立即刷新')
          return {
            template: 'Test2'
          }
        }
      },
    }
  ]
})
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
